package com.hrt.web.address.city.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hrt.base.BaseController;
import com.hrt.bean.City;
import com.hrt.web.address.city.service.CityServiceWeb;
@Controller
@RequestMapping("HRTWEB/address/city")
public class CityControllerWeb extends BaseController<City>{
	@Autowired 
	private CityServiceWeb cityServiceWeb;
	/**
	 * 
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/list")
	@ResponseBody
	public Map list(@RequestParam(value = "provincecode",required = true) String provincecode,
			HttpServletRequest request) {
		Map resultMap = new HashMap();
		List<City>cityList = cityServiceWeb.getByProvinceCode(provincecode);
		resultMap.put("cityList", cityList);
		return resultMap;

	}
}
